<?php
include_once('header.inc');
$words = $_POST['words'];
if($words=="")$words = $_GET['words'];
$key = $_GET['key'];
if($key=="")$key = "title";
?>
<table width="980" height="100%" 
border="0" align="center" cellpadding="0" cellspacing="0"  class="gen_tb">
  
  <tr>
    <td height="15" valign="bottom" bgcolor="#cccccc"></td>
    <td colspan="2" align="center" valign="top">
    <td width="777" align="left" valign="top" class="main-name-h">Search
    <td valign="bottom" bgcolor="#cccccc"></td>
  </tr>
  <tr>
    <td height="1230" valign="bottom" bgcolor="#cccccc"></td>
    <td width="200" align="left" valign="top">    <table>
    <tr><td>
<?php
$which_class = "Audio & Multimedia";
include_once("categories1.inc");
?>   
</td></tr> 
<tr><td>
      <p><BR class="main-txt">
      </p>
      <TABLE width=180 border=0 cellPadding=0 cellSpacing=0 background="images/middle.gif">
        <TBODY>
          <TR>
            <TD height="2" class="table-top"></TD>
          </TR>
          <TR>
            <TD align=center vAlign=top class="left">
            <script type="text/javascript"><!--
			google_ad_client = "pub-6483729784911405";
			//160x6001, 创建于 07-11-14
			google_ad_slot = "6427893699";
			google_ad_width = 160;
			google_ad_height = 600;
			//-->
			</script>
            <script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
       		</script></TD>
          </TR>
          <TR>
           <TD height="8" class="table-bottom"></TD>
          </TR>
        </TBODY>
      </TABLE>
</td></tr> 
<tr><td>     
      <BR>
      <TABLE width=180 
            border=0 align="center" cellPadding=0 cellSpacing=0 
            background="images/middle.gif">
        <TBODY>
          <TR>
           <TD width="8" height="2" class="table-top"></TD>
           <TD width="172" class="table-top"></TD>
          </TR>
          <TR>
            <TD align=left vAlign=center class="left-rss">:<BR>
                <BR>
                </p>
            </p></TD>
            <TD align=left vAlign=center class="left-rss">GOO SEARCH </TD>
          </TR>
          <TR>
            <TD height="8" colspan="2" class="table-bottom"></TD>
          </TR>
        </TBODY>
      </TABLE>
</td></tr> 
<tr><td> 
      <br>
      <TABLE width=180 
            border=0 align="center" cellPadding=0 cellSpacing=0 
            background="images/middle.gif">
        <TBODY>
          <TR>
            <TD width="8" height="2" class="table-top"></TD>
            <TD width="172" class="table-top"></TD>
          </TR>
          <TR>
            <TD align=left vAlign=center class="left-rss">:<BR>
                <BR>
                </p>
                </p></TD>
            <TD align=left vAlign=center class="left-rss"><span class="left-b"><img src="images/rss.gif" width="36" height="14">RSS Feeds</span><br>
               <img src="images/rss-1.gif" alt="new" width="14" height="14"><a href="rss.php">New Releases and Updates</a><br>
                  <img src="images/rss-1.gif" alt="new" width="14" height="14"><a href="rss.php?feed=popular">Most Popular Software</a><br>
                  <img src="images/rss-1.gif" alt="new" width="14" height="14"><a href="rss.php?feed=rating">Top Rated Software</a></td>
          </TR>
          <TR>
            <TD height="8" colspan="2" class="table-bottom"></TD>
          </TR>
        </TBODY>
      </TABLE>
</td></tr> </table>
    <td width="1" valign="top" background="images/line--3.gif">    
    <td valign="top">
      <TABLE cellSpacing=0 cellPadding=0 width="99%" align=center 
            border=0>
        <TBODY>
          <TR>
            <TD height=34 colspan="5" class=box_tbl_a><p class="main-name"><strong>Search by:</strong>   <A href="?key=Title&words=<?php echo  $words;?>">Title</A>  <A href="?key=description&words=<?php echo  $words;?>">Description</A> <A href="?key=keywords&words=<?php echo  $words;?>"> <strong>Keywords</strong> </A> <A href="?key=company&words=<?php echo  $words;?>">Company</A></p></TD>
          </TR>
          
          <TR>
            <TD height="21" class=main-name>All Programs search by <font color="Red"><?php echo $key?></font> with "<font color="Red"><?php echo $words?></font>"</TD>
            <TD class=main-name>Last update</TD>
            <TD class=main-name>Downloads</TD>
            <TD height="21" class=main-name>Buy now</TD>
            <TD class=main-name>Download</TD>
          </TR>
<?php

$sql = "SELECT * FROM paddata WHERE $key LIKE '%$words%' ";
//echo $sql;
$database->setQuery($sql);
$result = $database->loadAssocList();
//print_r($result);
foreach ($result as $query){
	$progid       = $query["progid"];
	$title        = htmlspecialchars($query["title"]);
	
	$pdate        = $query["pdate"];
	$cost         = sprintf("%01.2f",$query["cost"]);
	$ptype        = $query["ptype"];
	$affiliate    = htmlspecialchars($query["affiliate"]);
	$affiliateid  = $query["affiliateid"];
	$dlcount      = $query["dlcount"];
	$ksize        = number_format($query["ksize"]/1024, 2, '.', '');
	$msize 		  = number_format($query["ksize"]/1024/1024, 2, '.', '');
	if($msize>1){
		$ksize = $msize." M";
	}else {
		$ksize = $ksize." KB";
	}
	$buynowlnk = "";
	if($affiliate && $affiliateid) {
		$pick = "<img name=\"\" src=\"images/pick.gif\" width=\"23\" height=\"12\" alt=\"\">";
		if($affiliate == "RegNow") {
			$affiliatelnk = "https://www.regnow.com/softsell/nph-softsell.cgi?affiliate=" . $regnowafl . "&item=" . $affiliateid;
		}
		if($affiliate == "Share-It") {
			$affiliatelnk = "https://secure.shareit.com/shareit/checkout.html?affiliateid=" . $shareitafl . "&productid=" . $affiliateid;
		}
		if($affiliate == "eSellerate") {
			$affiliatelnk = "http://store.esellerate.net/a.asp?c=0_" . $affiliateid . "_" . $esellerateafl;
		}
		if($affiliate == "Plimus") {
			$affiliatelnk = "https://www.plimus.com/jsp/buynow.jsp?contractId=" . $affiliateid . "&referrer=" . $plimusafl;
		}
		if($affiliatelnk) {
			$buynowlnk = $affiliatelnk;
		}
	}
    echo "<TR>
            <TD height=\"18\" class=main-txt><a href='index04_p_$progid.html'>$title</a> </TD>
            <TD class=main-txt>$pdate</TD>
            <TD class=main-txt>$dlcount</TD>
            <TD height=\"18\" class=main-txt><a href=$buynowlnk>$$cost</a></TD>
            <TD height=\"18\" class=main-txt><a href=download_p_$progid.html>download</a></TD>
          </TR>";
          
}
?>
      </TBODY>
      </TABLE>
      <br>
    <td valign="bottom" bgcolor="#cccccc"></td>
  </tr>
  <tr>
    <td height="2" valign="bottom" bgcolor="#cccccc"></td>
    <td colspan="3" align="center" valign="top" background="images/line-3.gif">
    <td valign="bottom" bgcolor="#cccccc"></td>
  </tr>
  <tr>
    <td width="1" height="37" valign="bottom" bgcolor="#cccccc"></td>
    <td colspan="3" align="center" valign="top">
    <td width="1" valign="bottom" bgcolor="#cccccc"></td>
  </tr>
</table>
<?php
include_once('fooder.inc');
?>